﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FineUI.Examples
{
    public partial class major_updateAdminInfoBottom : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                string zhanghao = Request.QueryString["name"];
                string mima = Request.QueryString["pass"];
                string phone = Request.QueryString["admin_id"];
                TextBox4.Text = zhanghao;
                TextBox5.Text = mima;
            }
        }
        public void btnAdd_Click(object sender, EventArgs e)
        {
            string phone = Request.QueryString["admin_id"];
        
            string zhanghaoo = TextBox4.Text.Trim();
            string mimaa = TextBox5.Text.Trim();

            Maticsoft.BLL.major majorinfo = new Maticsoft.BLL.major();

            bool admininfo = majorinfo.updateAdminInfo(zhanghaoo, mimaa,phone);
            if (admininfo)
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('修改成功！');</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('修改成功，请重新查询管理员表！');</script>");
            }
        }
    }
}